package com.cjw.demo.controller;


import com.cjw.demo.entity.SysRegion;
import com.cjw.demo.service.ISysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 地区表 前端控制器
 * </p>
 *
 * @author cjw
 * @since 2021-11-19
 */
@RestController
@RequestMapping("/region")
public class SysRegionController {

    @Autowired
    ISysRegionService iSysRegionService;

    @RequestMapping("sheng")
    public List<SysRegion> lists(){
        List<SysRegion> list =iSysRegionService.lists(1);


        return list;
    }

    @RequestMapping("shi")
    public List<SysRegion> listshi(Integer province){
        //Integer parentId = sysRegion.getProvince();
        List<SysRegion> listshi =iSysRegionService.listshi(province);

        return listshi;
    }

    @RequestMapping("xian")
    public List<SysRegion> listxian(Integer province){
        //Integer paren = sysRegion.getCity();
        List<SysRegion> xianlist =iSysRegionService.listxian(province);


        return xianlist;
    }


}
